<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="viewport"
	content="width=device-width, maximum-scale=1.0, initial-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>UCKeFu-全渠道客服系统</title>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?t=1487250759056"/>
<link rel="stylesheet" href="/css/flexboxgrid.min.css">
<link rel="stylesheet" type="text/css" href="/css/darktooltip.css" />
<link rel="stylesheet" href="css/layui.css">
<link rel="stylesheet" href="/js/select/css/select2.min.css"/>	
<link rel="stylesheet" href="/res/css.html">

<link rel="stylesheet" type="text/css" href="/js/kindeditor/themes/default/default.css">

<script src="/js/jquery-1.10.2.min.js"></script>

<script src="/js/jquery.form.js"></script>

<script src="/js/select/js/select2.min.js"></script>

<script src="/layui.js"></script>
<script src="/js/ukefu.js"></script>
<script src="/im/js/socket.io.js"></script>	
<script src="/js/UCKeFu_IM.v1.js"></script>	

<script type="text/javascript" src="/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" src="/js/kindeditor/lang/zh-CN.js"></script>

<script type="text/javascript" src="/js/jquery.darktooltip.js"></script>
<script language="javascript">
	var hostname = "${hostname!''}"  , schema = "${schema!'http'}", port = "${webimport!''}" , userid = "${user.id!''}" , session = "${sessionid!''}" , orgi = "${orgi!''}";
	var layinx , layerhelper ;
	$(document).ready(function(){
		layui.use('layer', function(){
			layerhelper = layer ;
			<#if Request["msg"]?? && Request["msg"] == "security">
			layer.alert("您访问的资源需要安全验证，请确认您有系统管理员权限！", {icon: 2});
			</#if>
			<#if models?? && models["im"]?? && models["im"] == true>
			var imDialogHelper = {
				open : function(){
					layinx = layer.open({
						  type: 2,
						  title: false,
						  closeBtn: 0, //不显示关闭按钮
						  shade: [0],
						  area: ["200px", "50px"],
						  offset: "rb", //右下角弹出
						  anim: 2,
						  shade: 0,
						  content: "/ent/im/point.html",
						  end:function(){
							  layinx = layer.open({
								  type: 2,
								  title: false,
								  closeBtn: 0, //不显示关闭按钮
								  shade: [0],
								  area: ["260px", "520px"],
								  offset: "rb", //右下角弹出
								  anim: 2,
								  shade: 0,
								  content: ["/ent/im/index.html", "no"], //iframe的url，no代表不显示滚动条
								  end: function(){ //此处用于演示
									  imDialogHelper.open();	  
								  }
							  });
						  }
					});
				}		
			}
			imDialogHelper.open();
			</#if>
		});
		$('#agentstatus').on("click" , function(){
			if($(this).hasClass('layui-form-onswitch')){
				$(this).removeClass("layui-form-onswitch");
				loadURL("/agent/notready.html")
			}else{
				$(this).addClass("layui-form-onswitch");
				loadURL("/agent/ready.html") ;
			}
		});
		$(".ukefu-left-menu").darkTooltip({
    		gravity: "west"
    	});
	});
	function closeentim(){
		if(layerhelper){
			layerhelper.close(layinx);
		}	
	}
</script>

</head>

<body>
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header header header-ukefu">
			<div class="layui-main">
				<a class="logo" href="/"><img src="images/logo.png"></a>
				
				<ul class="layui-nav">
					<li class="layui-nav-item layui-this">
						<a href="javascript:void(0)" onclick="return false;" data-title="首页" data-href="/apps/content.html" class="iframe_btn" data-id="maincontent" data-type="tabChange">
							<i class="kfont" style="position: relative;">&#xe717;</i>
							首页
						</a>
					</li>
					<#if user?? && user.agent == true>
					<li class="layui-nav-item ">
						<a href="javascript:void(0)" id="agentdesktop" onclick="return false;"  data-title="坐席对话" data-href="/agent/index.html" class="iframe_btn" data-id="multiMediaDialogWin" data-type="tabAdd">
							<i class="kfont icon-iconfontagent"	style="position: relative;"></i>
							坐席工作台
						</a>
					</li>
					</#if>
					<li class="layui-nav-item ">
						<a href="javascript:void(0)" onclick="return false;"  data-title="系统管理" data-href="/admin/content.html" class="iframe_btn" data-id="admin" data-type="tabAdd">
							<i class="layui-icon" style="position: relative;">&#xe631;</i>
							系统管理
						</a>
					</li>
					
					<li class="layui-nav-item"><a href="javascript:void(0)">
						<i class="layui-icon" style="position: relative;">&#xe612;</i>
						<#if user??>${user.email!''}</#if></a>
						<dl class="layui-nav-child">
					      <dd><a href="/apps/profile.html" data-toggle="ajax" data-width="750" data-title="修改资料">个人资料</a></dd>
					      <dd><a href="/logout.html">退出系统</a></dd>
					    </dl>
					</li>
				</ul>
			</div>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<ul class="layui-nav layui-nav-tree site-ukefu-nav">

					<li class="layui-nav-item layui-nav-itemed">
						<dl class="layui-nav-child">
							
							<dd class="ukefu-left-menu">
								<a href="javascript:void(0)" onclick="return false;" data-title="首页" data-href="/apps/content.html" class="iframe_btn" data-id="maincontent" data-type="tabChange">
									<i class="kfont" style="top: 1px;">&#xe717;</i>
								</a>
							</dd>
							<#if user?? && user.agent == true>
							<dd class="ukefu-left-menu" data-tooltip="坐席工作台">
								<a href="/ukefu/layer.html" href="javascript:void(0)" onclick="return false;" data-title="坐席对话" data-href="/agent/index.html" class="iframe_btn" data-id="multiMediaDialogWin" data-type="tabAdd"> <i class="layui-icon"
									style="top: 3px;">&#xe63a;</i>
								</a>
							</dd>
							</#if>
							<#if models?? && models["contacts"]?? && models["contacts"] == true>
							<dd class="ukefu-left-menu" data-tooltip="全部联系人">
								<a href="javascript:void(0)" data-title="全部联系人" data-href="/apps/contacts/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> 
								<i class="layui-icon"	style="position: relative;">&#xe612;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="全部客户">
								<a href="javascript:void(0)" data-title="全部客户" data-href="/apps/customer/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> 
								<i class="kfont"	style="position: relative;">&#xe650;</i>
								</a>
							</dd>
							</#if>
							<#if models?? && models["workorders"]?? && models["workorders"] == true>
							<dd class="ukefu-left-menu" data-tooltip="工单管理">
								<a href="javascript:void(0)" data-title="工单管理" data-href="/apps/workorders/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> 
								<i class="kfont"	style="position: relative;">&#xe607;</i>
								</a>
							</dd>
							</#if>
							
							<dd class="ukefu-left-menu" data-tooltip="客服设置">
								<a href="javascript:void(0)" data-title="客服设置" data-href="/setting/agent/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="layui-icon"
									style="position: relative;">&#xe614;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="黑名单">
								<a href="javascript:void(0)" data-title="黑名单" data-href="/setting/blacklist.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="kfont"
									style="position: relative;">&#xe8a7;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="访客标签">
								<a href="javascript:void(0)" data-title="访客标签" data-href="/setting/tag.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="kfont"
									style="position: relative;">&#xe63f;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="快捷回复">
								<a href="javascript:void(0)" data-title="快捷回复" data-href="/setting/quickreply.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="kfont"
									style="position: relative;">&#xe63d;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="会话历史">
								<a href="javascript:void(0)" data-title="会话历史" data-href="/service/history/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="kfont"
									style="position: relative;">&#xe7eb;</i>
								</a>
							</dd>
							<dd class="ukefu-left-menu" data-tooltip="坐席列表">
								<a href="javascript:void(0)" data-title="坐席列表" data-href="/service/agent/index.html" class="iframe_btn" data-id="maincontent" data-type="tabChange"> <i class="kfont icon-iconfontagent"
									style="position: relative;"></i>
								</a>
							</dd>
							
						</dl>
					</li>
					<li class="layui-nav-item" style="height: 30px; text-align: center"></li>
				</ul>
			</div>
		</div>
		<div class="layui-body">
			<div class="layui-tab product-tab" lay-filter="ukefutab" lay-allowClose="true">
				<ul class="layui-tab-title">
					<li lay-id="maincontent" class="layui-this ukefu-home"><i class="kfont"
						style="position: relative;">&#xe717;</i> 首页</li>
				</ul>
				<#if user?? && user.agent == true>
				<#include "/public/agentstatus.html"/>
				</#if>
				<div class="layui-tab-content product-content ukefu-tab">
					<div class="layui-tab-item layui-show" style="height:100%;">
						<iframe frameborder="0" src="/apps/content.html" id="maincontent" name="maincontent" width="100%" height="100%"></iframe>
					</div>
				</div>
			</div>

		</div>
	</div>
	<script>
			layui.use('element', function(){
			  var $ = layui.jquery
			  ,element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
			  //触发事件
			  var active = {
				tabAdd: function(){
				  //新增一个Tab项
				  var href = $(this).data('href') ;
				  var title = $(this).data('title') ;
				  var id = $(this).data("id");
				  if($('#'+id).length == 0){
					  element.tabAdd('ukefutab', {
						title: title //用于演示
						,content: '<iframe frameborder="0" src="'+href+'" id="'+id+'" name="'+id+'" width="100%" height="100%"></iframe>'
						,id : id
					  });  
				  }
				  element.tabChange('ukefutab' , id);
				  $(".layui-this").each(function(){
					  if(!$(this).parent().hasClass("layui-tab-title")){
						  $(this).removeClass("layui-this");
					  }
					  
				  });
				  $('#'+id).attr("src" , href);
				}
				,tabChange: function(){
				  var id = $(this).data("id");
				  var inx = $('#'+id).parent().index();
				  var href = $(this).data('href') ;
				  if($('#'+id).length > 0){
					  $('#'+id).attr('src' , href) ;
					  element.tabChange('ukefutab' , id);
				  }
				  $(".layui-this").each(function(){
					  if(!$(this).parent().hasClass("layui-tab-title")){
						  $(this).removeClass("layui-this");
					  }
					  
				  });
				}
			  };
			  
			  $('.iframe_btn').on('click', function(){
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			  });
			});
		</script>
</body>

</html>